﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities.MSPetShop4
{
    partial class Inventory : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "ItemId":
                   {
                       return typeof(string);
                   }
                case "Qty":
                   {
                       return typeof(int);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Inventory _instance = instance as Inventory;
            switch (name)
            {                
                case "ItemId":
                   {
                       return _instance.ItemId;
                   }
                case "Qty":
                   {
                       return _instance.Qty;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Inventory _instance = instance as Inventory;
            switch (name)
            {                
                case "ItemId":
                    {
                        _instance.ItemId = (string)value;
                        return;
                    }
                case "Qty":
                    {
                        _instance.Qty = (int)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Inventory();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Inventory>();
        }

        #endregion
    }
}
